#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
//	system("start https://www.lanqiao.cn/problems/18499/learning/");

    int n;
    cin >> n;

    vector<string> s(n);

    for(auto & i : s)	cin >> i;

    unordered_set<string> st;
    for(int i = 0; i < n; i++)
        for(int j = 0; j < n; j++)
            if(i != j)
                st.insert(s[i] + s[j]);

    cout << st.size();

    return 0;
}

